const templates = (yourtype) => {
  if (yourtype === 1) {
    return <h1>This is h1</h1>;
  } else if (yourtype === 2) {
    return <h2>This is h2</h2>;
  } else if (yourtype === 3) {
    return <h3>This is h3</h3>;
  }else{
    return null
  }
};
function App() {
  return (
    <div className="App">
      {/* 模板精简原则 */}
      {templates(1)}
      {templates(2)}
      {templates(3)}
      {templates(9)}
    </div>
  );
}

export default App;
